package view.login
{
	import com.util.MakeChildrenUtil;
	
	import flash.events.MouseEvent;
	
	import view.View01_XMSprite;
	
	import xm.components.button.SWCButton;
	import xm.components.toast.Toast;
	import xm.view.ViewDefault;
	
	
	/**
	 * <br> 클래스 설명 : 애플리 케이션 메인뷰 </br>
	 * @author 강석민
	 */	
	public class LoginView extends ViewDefault
	{
		//-----------------------------------------------------------------------------------
		// public vars
		//-----------------------------------------------------------------------------------
		//-----------------------------------------------------------------------------------
		// protected / internal vars
		//-----------------------------------------------------------------------------------
		//-----------------------------------------------------------------------------------
		// private vars
		//-----------------------------------------------------------------------------------
		//-----------------------------------------------------------------------------------
		// public functions
		//-----------------------------------------------------------------------------------
		
		/**
		 * constructor 
		 */	
		public function LoginView()
		{
			super();
		}
		
		/**
		 * commitProperties
		 */		
		override public function commitProperties():void
		{
			super.commitProperties();
		}
		
		/**
		 * updateDisplayList
		 */		
		override public function updateDisplayList( enforce : Boolean = false ):void
		{
			super.updateDisplayList(enforce);
		}
		
		//-----------------------------------------------------------------------------------
		// life cycle functions
		//-----------------------------------------------------------------------------------
		
		/**
		 * createChildren
		 */		
		override public function createChildren():void
		{
			super.createChildren();
			
			//bg
			this.addChildAt( new BG_LOGIN, 0 );
			
			//로그인 버튼
			var loginBtn : SWCButton = MakeChildrenUtil.makeSwcBtn( new BTN_LOGIN );
			loginBtn.x = ( this.availableWidth - loginBtn.width ) /2;
			loginBtn.y = ( this.availableHeight - loginBtn.height ) /2 + 50;
			this.addChild( loginBtn );
			loginBtn.addEventListener(MouseEvent.CLICK , onLoginBtnClick );
			
		}
		
		/**
		 * createComplete
		 */		
		override public function creationComplete():void
		{
			super.creationComplete();
		}
		
		/**
		 * add
		 */		
		override public function add():void
		{
			super.add();
		}
		
		/**
		 * startAddTransition : add 완료 후 transition 이 있으면 화면전환효과를 실행한다.
		 */		
		override public function startAddTransition():void
		{
			super.startAddTransition();
		}
		
		/**
		 * startAddTransition 완료.
		 */		
		override public function endAddTransition():void
		{
			super.endAddTransition();
		}
		
		/**
		 * startRemoveTransition : remove 하기 전 transition 이 있으면 화면전환효과를 실행한다.
		 */		
		override public function startRemoveTransition():void
		{
			super.startRemoveTransition();
		}
		
		/**
		 * startRemoveTransition 완료.
		 */		
		override public function endRemoveTransition():void
		{
			super.endRemoveTransition();
		}
		
		/**
		 * remove
		 */		
		override public function remove():void
		{
			super.remove();
		}
		
		/**
		 * destroy
		 */		
		override public function destroy():void
		{
			super.destroy();
		}
		
		//-----------------------------------------------------------------------------------
		// setter / getter
		//-----------------------------------------------------------------------------------
		//-----------------------------------------------------------------------------------
		// protected functions
		//-----------------------------------------------------------------------------------
		//-----------------------------------------------------------------------------------
		// internal functions
		//-----------------------------------------------------------------------------------
		//-----------------------------------------------------------------------------------
		// private functions
		//-----------------------------------------------------------------------------------
		//-----------------------------------------------------------------------------------
		// event handler
		//-----------------------------------------------------------------------------------
		/**
		 *
		 */
		private function onLoginBtnClick(e:MouseEvent):void
		{
			this.navigator.add( View01_XMSprite );	
		}
		
		
	}
}